package ${package.Entity};

import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import top.continew.admin.common.base.model.entity.BaseDO;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.ExcelIgnore;

import java.io.Serial;
<#if hasTimeField?? && hasTimeField>
    import java.time.LocalDateTime;
</#if>

/**
* ${table.comment!}实体
*
* @author ${author}
* @since ${date}
*/
@Data
@TableName("${table.name}")
@ApiModel(description = "${table.comment!}实体")
public class ${entity} extends BaseDO {

@Serial
private static final long serialVersionUID = 1L;

<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
    <#if field.keyFlag>
        <#assign keyPropertyName="${field.propertyName}"/>
    </#if>

    <#if field.comment!?length gt 0>
        /**
        * ${field.comment}
        */
        @ApiModelProperty(value = "${field.comment}")
    </#if>
    <#if field.keyFlag>
    <#-- 主键 -->
        <#if field.keyIdentityFlag>
            @TableId(value = "${field.name}", type = IdType.AUTO)
            @ExcelIgnore
        <#elseif idType??>
            @TableId(value = "${field.name}", type = IdType.${idType})
            @ExcelIgnore
        <#elseif field.convert>
            @TableId("${field.name}")
            @ExcelIgnore
        </#if>
    <#-- 普通字段 -->
    <#elseif field.fill??>
    <#-- -----   存在字段填充设置   ----->
        <#if field.convert>
            @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
        <#else>
            @TableField(fill = FieldFill.${field.fill})
        </#if>
    <#elseif field.convert>
        @TableField("${field.name}")
    <#else>
        @TableField("${field.name}")
    </#if>
    <#if !field.keyFlag>
        @ExcelProperty("${field.comment}")
    </#if>
    private ${field.propertyType} ${field.propertyName};
</#list>
<#--  END 字段循环遍历  ---------->
}